home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #15
/
Monster Media Number 15 (Monster Media)(July 1996).ISO
/
netmail
/
rnr214.zip
/
COLORNMS.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1996-04-03
|
2KB
|
70 lines
unit colornms; { colornms.pas - map color names to numbers }
{
Russell_Schulz@locutus.ofB.ORG (960403)
Copyright 1996 Russell Schulz
this code is not in the Public Domain
permission is granted to use these routines in any application regardless
of commercial status as long as the author of these routines assumes no
liability for any damages whatsoever for any reason. have fun.
}
interface
uses crt,genericf;
function colortoi(acolorstring: string): integer;
implementation
function colortoi;
var
result: integer;
lowcolor: string;
begin
result := 0;
lowcolor := lower(trim(ltrim(acolorstring)));
if lowcolor='black' then result := black
else if lowcolor='blue' then result := blue
else if lowcolor='green' then result := green
else if lowcolor='cyan' then result := cyan
else if lowcolor='red' then result := red
else if lowcolor='magenta' then result := magenta
else if lowcolor='brown' then result := brown
else if lowcolor='lightgray' then result := lightgray
else if lowcolor='lightgrey' then result := lightgray
else if lowcolor='light-gray' then result := lightgray
else if lowcolor='light-grey' then result := lightgray
else if lowcolor='darkgray' then result := darkgray
else if lowcolor='darkgrey' then result := darkgray
else if lowcolor='dark-gray' then result := darkgray
else if lowcolor='dark-grey' then result := darkgray
else if lowcolor='lightblue' then result := lightblue
else if lowcolor='light-blue' then result := lightblue
else if lowcolor='lightgreen' then result := lightgreen
else if lowcolor='light-green' then result := lightgreen
else if lowcolor='lightcyan' then result := lightcyan
else if lowcolor='light-cyan' then result := lightcyan
else if lowcolor='lightred' then result := lightred
else if lowcolor='light-red' then result := lightred
else if lowcolor='lightmagenta' then result := lightmagenta
else if lowcolor='light-magenta' then result := lightmagenta
else if lowcolor='yellow' then result := yellow
else if lowcolor='white' then result := white
else
begin
result := atoi(lowcolor);
end;
colortoi := result;
end;
end.